<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="keywords" content="董哲朋,博客,杰森,工程师杰森,攻城狮杰森,程序员杰森,jason,jasoncoding,pdpeng.github.io,coder-jason,杰森,工程师,攻城狮,程序员,blog,杰森的博客,全栈杰森,Jason,全栈">
<meta name="description" content="董哲朋的个人技术博客，进军 BAT">
<meta name="baidu-site-verification" content="code-QreKZHvhxr" />
<meta name="google-site-verification" content="09pUELCUBq1DqCCF38Yh2tJ3Ym_AwCrftq7Nuj6RFKU" />
<meta name="baidu-site-verification" content="code-UgQbVCF7gr" />
<meta name="google-site-verification" content="2Z5MbRq2MYkpxhxZigsnWu_02ovzdGiRJNOzHc_yq58" />
<meta name="sogou_site_verification" content="kR3XmMWqhc" />
<meta name="viewport" content="width=device-width">
<meta name="referrer" content="no-referrer" /> <!--临时解决防盗链-->
<meta name="theme-color" content="#222" media="(prefers-color-scheme: light)">
<meta name="theme-color" content="#222" media="(prefers-color-scheme: dark)"><meta name="generator" content="Hexo 6.3.0">

<link rel="preconnect" href="null//null" crossorigin>
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">
  <meta name="google-site-verification" content="yRcH84LYotQhqYFJcwA5UzGRX_E_HGt7EWyA1hBqqWU">
  <meta name="msvalidate.01" content="yRcH84LYotQhqYFJcwA5UzGRX_E_HGt7EWyA1hBqqWU">
  <meta name="yandex-verification" content="8db608d56597d365">
  <meta name="baidu-site-verification" content="code-SSriojapxO">

<link rel="stylesheet" href="/css/main.css">



<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/animate.css@3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" integrity="sha256-Vzbj7sDDS/woiFS3uNKo8eIuni59rjyNGtXfstRzStA=" crossorigin="anonymous">

<script class="next-config" data-name="main" type="application/json">{"hostname":"pdpeng.github.io","root":"/","images":"/images","scheme":"Mist","darkmode":true,"version":"8.11.1","exturl":true,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":true,"bookmark":{"enable":false,"color":"#222","save":"manual"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"utterances","storage":true,"lazyload":true,"nav":null,"activeClass":"utterances"},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>



<link rel="canonical" href="https://pdpeng.github.io/2022/04/08/tcp-ip-protocol/">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://pdpeng.github.io/2022/04/08/tcp-ip-protocol/","path":"2022/04/08/tcp-ip-protocol/","title":"【图解】三次握手，四次挥手 —— 用心看这一篇就够了"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>【图解】三次握手，四次挥手 —— 用心看这一篇就够了 | 攻城狮杰森</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-5S6WNTLJG7"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"G-5S6WNTLJG7","only_pageview":false}</script>
  <script src="/js/third-party/analytics/google-analytics.js"></script>

  <script src="/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?11b3816992997637c6abc9c18c3eb3e5"></script>

  <script async src="//assets.growingio.com/2.1/gio.js"></script>
  <script class="next-config" data-name="growingio_analytics" type="application/json">"88ac8d4f08101068"</script>
  <script src="/js/third-party/analytics/growingio.js"></script>



  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="攻城狮杰森" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">攻城狮杰森</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">董哲朋的博客</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">22</span></a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">105</span></a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">28</span></a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%F0%9F%93%9A%E6%A6%82%E8%BF%B0"><span class="nav-number">1.</span> <span class="nav-text">📚概述</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%F0%9F%93%9A%E5%9F%BA%E7%A1%80%E7%90%86%E8%AE%BA"><span class="nav-number">2.</span> <span class="nav-text">📚基础理论</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%F0%9F%93%90%E4%BC%A0%E8%BE%93%E6%8E%A7%E5%88%B6%E5%8D%8F%E8%AE%AE"><span class="nav-number">2.1.</span> <span class="nav-text">📐传输控制协议</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%9C%92%EF%B8%8FTCP-%E7%89%B9%E7%82%B9"><span class="nav-number">2.1.1.</span> <span class="nav-text">✒️TCP 特点</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E2%9C%92%EF%B8%8FTCP-%E6%8A%A5%E6%96%87%E9%A6%96%E9%83%A8"><span class="nav-number">2.1.2.</span> <span class="nav-text">✒️TCP 报文首部</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%F0%9F%93%9ATCP-%E8%BF%9E%E6%8E%A5%E7%9A%84%E5%BB%BA%E7%AB%8B%E4%B8%8E%E9%87%8A%E6%94%BE"><span class="nav-number">3.</span> <span class="nav-text">📚TCP 连接的建立与释放</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%F0%9F%93%90%E4%B8%89%E6%AC%A1%E6%8F%A1%E6%89%8B"><span class="nav-number">3.1.</span> <span class="nav-text">📐三次握手</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%F0%9F%93%90%E5%9B%9B%E6%AC%A1%E6%8C%A5%E6%89%8B"><span class="nav-number">3.2.</span> <span class="nav-text">📐四次挥手</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%F0%9F%93%9A%E6%80%BB%E7%BB%93"><span class="nav-number">4.</span> <span class="nav-text">📚总结</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <a href="/">
    <img class="site-author-image" itemprop="image" alt="董哲朋"
      src="/images/head_portrait.png">
    </a>
  <p class="site-author-name" itemprop="name">董哲朋</p>
  <div class="site-description" itemprop="description" style="padding-bottom: 8px">A blacksmith must be strong</div>

<html>
<head>
    <style>
        .chat-button div {
            display: block;
            margin-top: 5px;
            background-color: transparent;
            position: relative;
            font-family: 'Lato', "PingFang SC", "Microsoft YaHei", sans-serif;
            font-size: 14px;
            line-height: 2;
        }

        .feed-link a {
            display: inline-block;
            padding: 0 15px;
            color: #fc6423;
            border: 2px solid #fc6423;
            border-radius: 6px;
            text-decoration: none;
        }

        .feed-link a:hover {
            background-color: #fc6423;
            border-bottom-color: #fc6423;
            color: #fff;
        }
    </style>
</head>

<body class="chat-button">
    <div class="feed-link" title="Q&A → Blog-Jason/community">
        <a target="_blank" rel="noopener" href="https://gitter.im/Blog-Jason/community">
            Q&A
        </a>
    </div>
</body>
</html>

</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">105</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">22</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">28</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly93d3cubGlua2VkaW4uY29tL2luL2Rvbmd6aGVwZW5n" title="Linkedin → https:&#x2F;&#x2F;www.linkedin.com&#x2F;in&#x2F;dongzhepeng"><i class="fab fa-linkedin fa-fw"></i>Linkedin</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly90d2l0dGVyLmNvbS9qYXNvbmk5OTY=" title="Twitter → https:&#x2F;&#x2F;twitter.com&#x2F;jasoni996"><i class="fab fa-twitter fa-fw"></i>Twitter</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="bWFpbHRvOmR6aGVwZW5nQGdtYWlsLmNvbQ==" title="E-Mail → mailto:dzhepeng@gmail.com"><i class="fa fa-envelope fa-fw"></i>E-Mail</span>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9zdGFja292ZXJmbG93LmNvbS91c2Vycy8xNjY0ODc1NA==" title="S.O. → https:&#x2F;&#x2F;stackoverflow.com&#x2F;users&#x2F;16648754"><i class="fab fa-stack-overflow fa-fw"></i>S.O.</span>
      </span>
      <span class="links-of-author-item">
        <a href="/atom.xml" title="RSS → &#x2F;atom.xml"><i class="fa fa-rss fa-fw"></i>RSS</a>
      </span>
      <span class="links-of-author-item">
        <span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzUxMjY5OTYx" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;m0_51269961"><i class="fa-solid fa-c fa-fw"></i>CSDN</span>
      </span>
  </div>
  <div class="cc-license site-overview-item animated" itemprop="license">
    <span class="exturl cc-opacity" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC8="><img src="https://cdn.jsdelivr.net/npm/@creativecommons/vocabulary@2020.11.3/assets/license_badges/small/by_nc_sa.svg" alt="Creative Commons"></span>
  </div>



        </div>
      </div>

      
      <script type="text/javascript" charset="utf-8" src="/js/tagcloud.js"></script>
      <script type="text/javascript" charset="utf-8" src="/js/tagcanvas.js"></script>
      <div class="widget-wrap">
          <div id="myCanvasContainer" class="widget tagcloud">
              <canvas width="250" height="250" id="resCanvas" style="width:100%">
                  <ul class="tag-list" itemprop="keywords"><li class="tag-list-item"><a class="tag-list-link" href="/tags/ACM/" rel="tag">ACM</a><span class="tag-list-count">32</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/C/" rel="tag">C++</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CDN/" rel="tag">CDN</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/CPU/" rel="tag">CPU</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/DNS/" rel="tag">DNS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Git/" rel="tag">Git</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/HarmonyOS/" rel="tag">HarmonyOS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Hexo/" rel="tag">Hexo</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/IOS/" rel="tag">IOS</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Java/" rel="tag">Java</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Linux/" rel="tag">Linux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Markdown/" rel="tag">Markdown</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/MySQL/" rel="tag">MySQL</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Python/" rel="tag">Python</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/RT-Thread/" rel="tag">RT-Thread</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/SQLServer/" rel="tag">SQLServer</a><span class="tag-list-count">9</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/TCP-IP/" rel="tag">TCP&#x2F;IP</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Tomcat/" rel="tag">Tomcat</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/Vivado/" rel="tag">Vivado</a><span class="tag-list-count">2</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E4%BA%91%E5%AD%98%E5%82%A8/" rel="tag">云存储</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E5%89%8D%E7%AB%AF/" rel="tag">前端</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/" rel="tag">服务器</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%A8%8B%E5%BA%8F%E4%BA%BA%E7%94%9F/" rel="tag">程序人生</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E7%BC%96%E7%A0%81/" rel="tag">编码</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%81%8C%E4%B8%9A%E8%AE%A4%E8%AF%81/" rel="tag">职业认证</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88/" rel="tag">解决方案</a><span class="tag-list-count">6</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%A7%A3%E6%9E%90%E5%87%A0%E4%BD%95/" rel="tag">解析几何</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E8%A7%86%E8%A7%89/" rel="tag">计算机视觉</a><span class="tag-list-count">1</span></li></ul>
              </canvas>
          </div>
      </div>
      
        <div class="back-to-top animated" role="button" aria-label="返回顶部">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    
  <div class="reading-progress-bar"></div>

  <span class="exturl github-corner" data-url="aHR0cHM6Ly9naXRodWIuY29tL1BEUEVORw==" title="Follow Jason on GitHub" aria-label="Follow Jason on GitHub"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></span>

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://pdpeng.github.io/2022/04/08/tcp-ip-protocol/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/head_portrait.png">
      <meta itemprop="name" content="董哲朋">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="攻城狮杰森">
      <meta itemprop="description" content="A blacksmith must be strong">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="【图解】三次握手，四次挥手 —— 用心看这一篇就够了 | 攻城狮杰森">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          【图解】三次握手，四次挥手 —— 用心看这一篇就够了
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2022-04-08 19:41:31" itemprop="dateCreated datePublished" datetime="2022-04-08T19:41:31+08:00">2022-04-08</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/" itemprop="url" rel="index"><span itemprop="name">计算机网络</span></a>
        </span>
    </span>

  
    <span id="/2022/04/08/tcp-ip-protocol/" class="post-meta-item leancloud_visitors" data-flag-title="【图解】三次握手，四次挥手 —— 用心看这一篇就够了" title="阅读次数">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span class="leancloud-visitors-count"></span>
    </span>
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>3.9k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>4 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <blockquote>
<p>👲👲<font color=#a2a837 size=3>作者主页</font>：🔗<span class="exturl" data-url="aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzUxMjY5OTYx">杰森的博客<i class="fa fa-external-link-alt"></i></span><br>📒📒<font color=#20b9cd size=3>本文摘要</font>：<strong>TCP 三次握手，四次挥手知识点精析。备考、面试前看两眼，加深记忆，祝你一臂之力。顺利通过考试、拿到 offer。</strong><br>💖💖如果本文帮助到你的话，还请各位小伙伴👍点赞➕收藏⭐➕评论💭支持杰森呀✌️</p>
</blockquote>
<center><img src="https://img-blog.csdnimg.cn/ec1b86b9ee7b4b939c433744378c4c51.png"></center>

<hr>
<h1 id="📚概述"><a href="#📚概述" class="headerlink" title="📚概述"></a>📚概述</h1><p>“什么是三次握手，四次挥手？”，该问题作为<strong>计算机网络</strong>学科中常见问题之一，无论是面试还是考研，我们都有必要细细参透其中的奥妙</p>
<p>在学习之前，我们首先需要了解一些基本的概念</p>
<h1 id="📚基础理论"><a href="#📚基础理论" class="headerlink" title="📚基础理论"></a>📚基础理论</h1><h2 id="📐传输控制协议"><a href="#📐传输控制协议" class="headerlink" title="📐传输控制协议"></a>📐传输控制协议</h2><blockquote>
<p>传输控制协议（<strong>T</strong>ransmission <strong>C</strong>ontrol <strong>P</strong>rotocol）是一种面向连接的、可靠的、基于字节流的传输层通信协议，在 OSI 模型中完成传输层指定功能。<br>TCP 使用<strong>校验和函数</strong>检验数据是否出现错误，在数据发送和接收时均需要计算<strong>校验和</strong>。</p>
</blockquote>
<span id="more"></span>

<h3 id="✒️TCP-特点"><a href="#✒️TCP-特点" class="headerlink" title="✒️TCP 特点"></a>✒️TCP 特点</h3><p><strong>1.TCP 是面向连接的传输层协议</strong></p>
<blockquote>
<p>应用程序在使用 TCP 协议前，必须首先完成 TCP 连接的建立。在数据传输结束后，必须释放先前已建立的 TCP 连接</p>
</blockquote>
<p><strong>2.每一条 TCP 连接只能有两个端点</strong></p>
<blockquote>
<p>TCP 连接只能是点对点，一对一的</p>
</blockquote>
<p><strong>3.TCP 提供可靠交付服务</strong></p>
<blockquote>
<p>通过 TCP 连接传送的数据，无差错、不丢失、不重复，且按序到达</p>
</blockquote>
<p><strong>4.TCP 提供全双工通信</strong></p>
<blockquote>
<p>TCP 允许通信双方的应用进程在<strong>任何时候</strong>都可以发送数据，TCP连接的两端都设有<strong>发送、接收缓存</strong>，用于临时存放双向通信的数据，上层应用进程在时机恰当时会读取缓存中的数据</p>
</blockquote>
<p><strong>5.TCP 面向字节流</strong></p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/f4ea53de5a6e404bb27e80234e4b5292.png" />
        </center>
        <center>
        <strong>图 1 TCP 面向字节流示意图</strong>
        </center></td> 
    <tr>
</table>

<blockquote>
<p><strong>流</strong>是指：流入到进程或从进程流出的<strong>字节序列</strong><br>TCP 把应用程序回传的数据看做一连串的<strong>无结构</strong>的字节流，不保证接收方应用程序所收到的数据块和发送方应用程序所发出的数据块具有对应大小的关系<br>接收方应用程序收到的字节流必须和发送方应用程序发出的字节流完全一致，且接收方的应用程序必须具有识别接收字节流，并将其还原为有意义的应用层数据的能力</p>
</blockquote>
<h3 id="✒️TCP-报文首部"><a href="#✒️TCP-报文首部" class="headerlink" title="✒️TCP 报文首部"></a>✒️TCP 报文首部</h3><p>这里需要了解 TCP 报文首部的格式，相关<strong>控制位</strong>非常重要</p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/f4ea53de5a6e404bb27e80234e4b5292.png" />
        </center>
        <center>
        <strong>图 2 TCP 报文首部的格式示意图</strong>
        </center></td> 
    <tr>
</table>

<blockquote>
<p>由于 TCP 报文段首部的前 20 个字节是固定的，其后 4n 个字节是根据需要增加的选项，所以 TCP首部的最小长度是 20 字节</p>
</blockquote>
<p><strong>1.源端口和目的端口</strong></p>
<blockquote>
<p>各占 2 字节，分别写入源端口号、目的端口号</p>
</blockquote>
<p><strong>2.序号字段</strong></p>
<blockquote>
<p>占 4 字节，范围为 <code>[0，2 ^ 32-1]</code>，序号使用 <code>mod2^32</code> 运算，在一个TCP连接中传送的字节流中的每一个字节都按顺序编号。整个要传送的字节流的起始序号必须在连接建立时设置，首部中的序号字段值则指的是本报文段所发送的数据的第一个字节的序号</p>
</blockquote>
<p><strong>3.确认号字段</strong></p>
<blockquote>
<p>占4字节，是期望收到对方下一个报文段的第一个数据字节的序号。若确认号等于 N，则表明：到序号 N-1 为止数据均己正确接收</p>
</blockquote>
<p><strong>4.数据偏移字段</strong></p>
<blockquote>
<p>占 4 位，指出 TCP 报文段的数据起始处和 TCP 报文段的起始处的距离。此字段实际上指出了 TCP 报文段的首部长度</p>
</blockquote>
<p><strong>5.保留字段</strong></p>
<blockquote>
<p>占 6 位，保留为今后使用，目前应置为0</p>
</blockquote>
<p><strong>6.紧急 URG</strong></p>
<blockquote>
<p>URG&#x3D;1时，表明紧急指针字段有效，它告诉系统此报文段中有紧急数据，应尽快传送，即提高数据传送的优先级</p>
</blockquote>
<p><strong>7.确认 ACK</strong></p>
<blockquote>
<p>仅当 ACK&#x3D;1 时确认号字段才有效，TCP 规定，在连接建立后所有传送的报文段必须将 ACK 置为 1</p>
</blockquote>
<p><strong>8.推送 PSH</strong></p>
<blockquote>
<p>接收 TCP 收到 PSH&#x3D;1 的报文段后，将尽快交付接收的应用进程，不再等到缓存都填满后再继续向上交付</p>
</blockquote>
<p><strong>9.复位 RST</strong></p>
<blockquote>
<p>当 RST&#x3D;1 时，表明 TCP 连接中出现严重差错，必须释放连接，然后再重新建立传输连接。也可以用于拒绝一个非法的报文段或拒绝打开一个连接</p>
</blockquote>
<p><strong>10.同步 SYN</strong></p>
<blockquote>
<p>连接建立时用来同步序号，SYN&#x3D;1就表示这是一个连接请求或连接接受报文</p>
</blockquote>
<p><strong>11.终止 FIN</strong></p>
<blockquote>
<p>用于释放一个连接，当 FIN&#x3D;1 时，表明此报文段的发送方的数据己发送完毕，并要求释放传输连接</p>
</blockquote>
<p><strong>12.窗口字段</strong></p>
<blockquote>
<p>占 2 字节，窗口值范围为 <code>[0，2^16-1]</code> 之间的整数。窗口是指发送本报文段的一方的接收窗口，窗口值作为接收方让发送方设置其发送窗口的依据</p>
</blockquote>
<p><strong>13.检验和字段</strong></p>
<blockquote>
<p>占 2 字，检验和字段检验的范围包括首部和数据两部分</p>
</blockquote>
<p><strong>14.紧急指针</strong></p>
<blockquote>
<p>占 2 字节，仅当 URG&#x3D;1 时才有意义，含义是：本报文段中的紧急数据的字数，紧急指针指出了紧急数据的末尾在报文段中的位置<br>当所有紧急数据都处理完时，TCP就告诉应用程序恢复到正常操作。注意：即使窗口为零时也可发送紧急数据</p>
</blockquote>
<p><strong>15.选项字段</strong></p>
<blockquote>
<p>长度可变，最长可达 40 字节。未使用“选项”时，TCP 首部长度为 20 字节</p>
</blockquote>
<h1 id="📚TCP-连接的建立与释放"><a href="#📚TCP-连接的建立与释放" class="headerlink" title="📚TCP 连接的建立与释放"></a>📚TCP 连接的建立与释放</h1><h2 id="📐三次握手"><a href="#📐三次握手" class="headerlink" title="📐三次握手"></a>📐三次握手</h2><p><code>TCP</code> 建立连接的过程称为<strong>握手</strong>，握手需要在客户端和服务器之间交换三个 <code>TCP</code> 报文段</p>
<p>我们举一个简单的例子帮助大家理解这个问题：试想下面这个场景</p>
<blockquote>
<p>你出门在外没带钥匙，而房屋钥匙又仅有一把，在不考虑钥匙丢失在哪里的情况下，今晚你还会回家吗？</p>
</blockquote>
<p>虽然此例子并不那么恰当，但是可以类比到三次握手的原因上。如果客户端和服务端有一方出现了问题，那么它们之间的通讯、资源传输必定会出问题</p>
<p>因此，<code>TCP</code> 三次握手的作用就是使客户端和服务端双方都明确自己的责任，<strong>保证双方都具有资源接收和发送的能力</strong></p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/79c6cf6c941d4893b1456332e8fbb4bb.png" />
        </center>
        <center>
        <strong>图 3 TCP 三次握手示意图</strong>
        </center></td> 
    <tr>
</table>


<p>字符释意：</p>
<ul>
<li><code>ACK</code>：确认报文段</li>
<li><code>ack</code>：确认号</li>
<li><code>SYN</code>：发送连接请求 &#x2F; 接收报文段&#96;</li>
<li><code>seq</code>：发送数据的第一个字节的序号</li>
</ul>
<p>客户端与服务端资源收发的<strong>三次握手</strong>过程如下：</p>
<p>*注：图例中的 <code>Ss</code>、<code>Sa</code> 分别表示 <code>Server send</code>、<code>Server accept</code>（服务端发送能力、服务端接收能力）；<code>Cs</code>、<code>Ca</code> 分别表示 <code>Client send</code>、<code>Client accept</code>（客户端发送能力、客户端接收能力）</p>
<p><strong>1.第一次握手</strong></p>
<blockquote>
<p>第一次握手由客户端发送资源包给到服务端，若该过程正常，则得出结论：<strong>服务端接收、客户端发送服务正常</strong></p>
</blockquote>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/f7080ba46eda468f8161c9530afd6716.png" />
        </center>
        <center>
        <strong>图 4 TCP 建立连接第一次握手示意图</strong>
        </center></td> 
    <tr>
</table>

<p><strong>2.第二次握手</strong></p>
<blockquote>
<p>第二次握手由服务端发送资源包给到客户端，若该过程正常，则得出结论：<strong>服务端发送、客户端接收服务正常</strong></p>
</blockquote>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/f60f1ebbe4e741e0b1c69e133a7111a7.png" />
        </center>
        <center>
        <strong>图 5 TCP 建立连接第二次握手示意图</strong>
        </center></td> 
    <tr>
</table>

<p><strong>3.第三次握手</strong></p>
<p>这里大家可能就会有疑问了？为什么还需要进行第三次握手呢？前两次不是已经得出结论客户端、服务端接收、发送资源包能力正常了吗？</p>
<p>其实并不是，第一、二次握手只是在单独的过程中得出服务正常的结论，但是在第二次握手结束后，&#x3D;&#x3D;服务端的接收能力和客户端的发送能力未知&#x3D;&#x3D;，这时候便有了 <code>TCP</code> 的第三次握手过程</p>
<blockquote>
<p>第三次握手由客户端发送资源包给到服务端，若该过程正常，则得出结论：<strong>服务端接收、客户端发送服务正常</strong></p>
</blockquote>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/e261576429244398a6493858750005ca.png" />
        </center>
        <center>
        <strong>图 6 TCP 建立连接第三次握手示意图</strong>
        </center></td> 
    <tr>
</table>


<p>通过这三次的握手过程我们可以分析得到：第二次是对第一次握手的补充，第三次是对第二次握手的补充，最终正好形成闭环，客户端和服务端都确认了自己的接收、发送能力正常，之后方可进行通信</p>
<p>并且，要完成两者状态的监测，这之间<strong>至少</strong>需要三次过程，两次并不足以判断自身的服务状态。每一个步骤都相互关联，下一次握手的“响应”由上一次“请求“触发，每次握手得出的结论都是对上一次结果的补充，从而得出最终结果</p>
<p>三次握手过程中，客户端和服务端交换 <strong>I</strong>nitial <strong>S</strong>equence <strong>N</strong>umber (<code>ISN</code>)，为了使对方清除下一步接收到的数据信息应以何<strong>序列号</strong>进行数据整合</p>
<p>并且，ISN 在此过程中是动态生成的。假如 ISN 固定不变，入侵者非常容易就能得出后续数据的确认号，这将会危机到数据信息的安全</p>
<h2 id="📐四次挥手"><a href="#📐四次挥手" class="headerlink" title="📐四次挥手"></a>📐四次挥手</h2><p>当成功建立一个 <code>TCP</code> 连接， 服务端在 <code>LISTEN</code> 状态下，收到建立连接请求的 <code>SYN</code> 报文后，将 <code>ACK</code>和 <code>SYN</code> 存放到同一个报文中一起发送给客户端</p>
<p>而关闭连接时，服务端收到客户端的 <code>FIN</code> 报文时，仅表示对方不再发送数据，但仍然能够接收数据。此时，服务端不一定将全部数据都发送给了客户端</p>
<p>因此服务端关闭有两种方式：</p>
<ol>
<li>立即关闭</li>
<li>继续发送一些数据给客户端后，再发送 <code>FIN</code> 报文给客户端（表示同意关闭连接），是否立刻关闭发送数据通道，需交由上层应用决定</li>
</ol>
<p>所以，客户端的 <code>ACK</code> 和 <code>FIN</code> 一般都会分开发送，这里就会导致次数增加一</p>
<p>数据传输完毕后，双方均可释放连接。起初，客户端和服务端均处于 <code>ESTABLISHED</code> 状态，然后是客户端主动关闭，服务器被动关闭</p>
<p>整个过程请参考下图：</p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/7d3aa066c42843d9b03f0be303cd172c.png" />
        </center>
        <center>
        <strong>图 7 TCP 释放连接四次挥手示意图</strong>
        </center></td> 
    <tr>
</table>


<p>字符释意：</p>
<ul>
<li><code>FIN</code> ：连接终止位</li>
<li><code>seq</code>：发送的第一个字节的序号</li>
<li><code>ACK</code>：确认报文段</li>
<li><code>ack</code>：确认号</li>
</ul>
<p><strong>四次挥手过程：</strong></p>
<ul>
<li><p>客户端发送<strong>第一次</strong>挥手，之后由 <code>ESTABLISHED</code> 状态转为 <code>FIN_WAIT1</code> 状态</p>
</li>
<li><p>服务器收到客户端的第一次挥手之后，发送<strong>第二次挥手</strong>给服务器，服务器进入 <code>CLOSE_WAIT</code> 状态，等待服务器自身的 <code>SOCKET</code> 关闭等处理</p>
</li>
<li><p>客户端收到服务器的第二次挥手，进入 <code>FIN_WAIT2</code> 状态，等待服务器关闭</p>
</li>
<li><p>服务器发送<strong>第三次挥手</strong>，然后进入 <code>LAST_ACK</code> 状态</p>
</li>
<li><p>客户端收到第三次挥手，发送<strong>第四次挥手</strong>，客户端进入 <code>TIME_WAIT</code> 状态；</p>
</li>
<li><p>服务器收到第四次挥手，进入 <code>CLOSED</code> 状态，客户端等待 2MSL 后，进入 <code>CLOSED</code> 状态</p>
</li>
</ul>
<p>TCP 状态转换过程见下图：</p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/0db61377a65441618b9225814f94b12d.png" />
        </center>
        <center>
        <strong>图 8 TCP 状态转换过程示意图</strong>
        </center></td> 
    <tr>
</table>


<h1 id="📚总结"><a href="#📚总结" class="headerlink" title="📚总结"></a>📚总结</h1><p><code>TCP</code> 建立连接的三次握手是指发送了三个报文段，而 <code>TCP</code> 断开连接进行四次挥手是指发送了四个报文段，在此过程中，<code>SYN</code> 和 <code>FIN</code> 均利用重传进行可靠传输</p>
<p>连接的释放本质上两次就可以完成，但若想要完全释放，则需要四次挥手，请看下图</p>
<table border="0">
    <tr>
        <td><center>
        <img src="https://img-blog.csdnimg.cn/cddae2cec3a44844b0d4e62f74255baa.png" />
        </center>
        <center>
        <strong>图 9 TCP 连接释放举例</strong>
        </center></td> 
    <tr>
</table>


<p>打电话即将结束时，路人甲说完信息“OK，我没事了”后，路人乙回复到“嗯，知道啦”。这是就是完成了 TCP 四次挥手的前两次过程；路人乙马上要挂断电话时，路人甲又忽然想起来某件事，说了很多。这时路人乙又回复到“好的好的”。至此，TCP 四次挥手的后两次过程完毕</p>
<hr>
<center><strong><font size=5>💯冲啊！祝各位小伙伴都能拿到大厂 Offer ，成功上岸💯</font></strong></center>

<p><img src="https://img-blog.csdnimg.cn/d42a61657d7f4f75ae93c232f40bf46b.png"></p>

    </div>

    
    
    

    <footer class="post-footer">

        </br>
        <div class="official-accounts">
             <a target="_blank" rel="noopener" href="https://cdn.jsdelivr.net/gh/PDPENG/jason-storage/blog-img/Jason%20wechat%20account.png">
                 <img src="/images/official-accounts.png" width="80%">
             </a>
        </div>
          <div class="reward-container">
  <div>Thank you for your support to Jason ~</div>
  <button>
    赞赏
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/wechatpay.png" alt="董哲朋 微信">
        <span>微信</span>
      </div>
      <div>
        <img src="/images/alipay.png" alt="董哲朋 支付宝">
        <span>支付宝</span>
      </div>

  </div>
</div>

          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>董哲朋
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://pdpeng.github.io/2022/04/08/tcp-ip-protocol/" title="【图解】三次握手，四次挥手 —— 用心看这一篇就够了">https://pdpeng.github.io/2022/04/08/tcp-ip-protocol/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <span class="exturl" data-url="aHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LW5jLXNhLzQuMC8="><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</span> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

          <div class="post-tags">
              <a href="/tags/TCP-IP/" rel="tag"><i class="fa fa-tag"></i> TCP/IP</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/2022/04/09/lanqiao-2022-teamB/" rel="prev" title="【2022 蓝桥杯 B 组 C/C++ 真题】快来看看你做对几题">
                  <i class="fa fa-chevron-left"></i> 【2022 蓝桥杯 B 组 C/C++ 真题】快来看看你做对几题
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/2022/04/08/apsara-clouder-api/" rel="next" title="【Apsara Clouder 认证】API 接口调用真题">
                  【Apsara Clouder 认证】API 接口调用真题 <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    <div class="comments utterances-container"></div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">
<div class="copyright">
  &copy; 2020 – 
  <span itemprop="copyrightYear">2025</span>
  <span class="with-love">
    <i class="fa fa-code"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">董哲朋


<div class="sitetime" style="display: inline-block;">
<span id="sitetime"></span>
<script language=javascript>
	function siteTime(){
		window.setTimeout("siteTime()", 1000);
		var seconds = 1000;
		var minutes = seconds * 60;
		var hours = minutes * 60;
		var days = hours * 24;
		var years = days * 365;
		var today = new Date();
		var todayYear = today.getFullYear();
		var todayMonth = today.getMonth()+1;
		var todayDate = today.getDate();
		var todayHour = today.getHours();
		var todayMinute = today.getMinutes();
		var todaySecond = today.getSeconds();
		var t1 = Date.UTC(2020,09,23,13,15,00); //北京时间 2021-09-23 13:15:00
		var t2 = Date.UTC(todayYear,todayMonth,todayDate,todayHour,todayMinute,todaySecond);
		var diff = t2-t1;
		var diffYears = Math.floor(diff/years);
		var diffDays = Math.floor((diff/days)-diffYears*365);
		var diffHours = Math.floor((diff-(diffYears*365+diffDays)*days)/hours);
		var diffMinutes = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours)/minutes);
		var diffSeconds = Math.floor((diff-(diffYears*365+diffDays)*days-diffHours*hours-diffMinutes*minutes)/seconds);
		document.getElementById("sitetime").innerHTML=" 本站已安全运行 "+diffYears+" 年 "+diffDays+" 天 "+diffHours+" 小时 "+diffMinutes+" 分钟 "+diffSeconds+" 秒 ";
	}
	siteTime();
</script>
</div>
  </span>
</div>
<div class="wordcount" style="display: inline-block;">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
      <span>站点总字数：</span>
    <span title="站点总字数">312k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span>站点阅读时长 &asymp;</span>
    <span title="站点阅读时长">4:43</span>
  </span>
    <div class="beian" style="display: inline-block;">
        <img src="/images/beian.png" alt=""><span class="exturl" data-url="aHR0cDovL3d3dy5iZWlhbi5nb3YuY24vcG9ydGFsL3JlZ2lzdGVyU3lzdGVtSW5mbz9yZWNvcmRjb2RlPTQxMDU4MTAyMDAwMjQx">豫公网安备 41058102000241号 </span>
        <img src="/images/beian.png" alt=""><span class="exturl" data-url="aHR0cHM6Ly9iZWlhbi5taWl0Lmdvdi5jbg==">豫ICP备2021028259号-1 </span>
    </div>

</div>

    </div>
  </footer>

  
  <script src="https://cdn.jsdelivr.net/npm/animejs@3.2.1/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@next-theme/pjax@0.5.0/pjax.min.js" integrity="sha256-3NkoLDrmHLTYj7csHIZSr0MHAFTXth7Ua/DDt4MRUAg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" integrity="sha256-yt2kYMy0w8AbtF89WXb2P1rfjcP/HTHLT7097U8Y5b8=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/schemes/muse.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  
<script src="https://cdn.jsdelivr.net/npm/hexo-generator-searchdb@1.4.0/dist/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>



  <script src="/js/third-party/fancybox.js"></script>


  


  <script class="next-config" data-name="leancloud_visitors" type="application/json">{"enable":true,"app_id":"XnAU2LpE7JlHt34KKmw24BoM-MdYXbMMI","app_key":"vphcyLncudT8YkHIgks4F1r2","server_url":null,"security":false}</script>
  <script src="/js/third-party/statistics/lean-analytics.js"></script>


  

  <script class="next-config" data-name="enableMath" type="application/json">false</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdn.jsdelivr.net/npm/mathjax@3.2.0/es5/tex-mml-chtml.js","integrity":"sha256-r+3itOMtGGjap0x+10hu6jW/gZCzxHsoKrOd7gyRSGY="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>


<script src="https://cdn.jsdelivr.net/gh/PDPENG/live2d-widget@latest/autoload.js"></script><script class="next-config" data-name="utterances" type="application/json">{"enable":true,"repo":"PDPENG/pdpeng.github.io","issue_term":"pathname","theme":"preferred-color-scheme"}</script>
<script src="/js/third-party/comments/utterances.js"></script>

</body>
</html>
